package cn.iocoder.yudao.module.member.dal.mysql.usercreativeremark;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.member.dal.dataobject.usercreativeremark.UserCreativeRemarkDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.member.controller.admin.usercreativeremark.vo.*;

/**
 * 创意文案关联评论 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface UserCreativeRemarkMapper extends BaseMapperX<UserCreativeRemarkDO> {

    default PageResult<UserCreativeRemarkDO> selectPage(UserCreativeRemarkPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserCreativeRemarkDO>()
                .betweenIfPresent(UserCreativeRemarkDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(UserCreativeRemarkDO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserCreativeRemarkDO::getCreativeId, reqVO.getCreativeId())
                .eqIfPresent(UserCreativeRemarkDO::getRemark, reqVO.getRemark())
                .eqIfPresent(UserCreativeRemarkDO::getParentId, reqVO.getParentId())
                .orderByDesc(UserCreativeRemarkDO::getId));
    }

}